Method, apparatus, and system for selecting network device

ABSTRACT

Embodiments of the present invention disclose apparatuses. The apparatus includes a program instructing hardware and a computer readable storage medium coupled to the hardware and storing programming instructions for execution by the hardware, the programming instructions instruct the hardware to: receive a network device selection message sent by a first network device, where the network device selection message contains a virtual local area network (VLAN) mapping capability identifier of the first network device and a device identifier of the first network device; when determining that both the apparatus and the first network device have VLAN mapping capability according to local VLAN mapping capability and the VLAN mapping capability identifier of the first network device, select a network device for executing VLAN mapping according to sizes or a sequence of a local device identifier and the device identifier of the first network device.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.13/937,938, filed on Jul. 9, 2013, which is a continuation ofInternational Patent Application No. PCT/CN2011/080809, filed on Oct.14, 2011, which claims priority to Chinese Patent Application No.201110004507.0, filed on Jan. 11, 2011. The afore-mentioned patentapplications are hereby incorporated by reference in their entireties.

TECHNICAL FIELD

Embodiments of the present invention relates to the field of networkcommunications, and in particular to a method, an apparatus, and asystem for selecting a network device.

BACKGROUND

An Ethernet tree (E-Tree) is an Ethernet virtual circuit (EVC) servicedefined by the metro Ethernet forum (MEF). The E-Tree has the followingfeatures:

A root node and a leaf node are in a one-to-multiple relationship, andmultiple root nodes may exist;

a root node may send an Ethernet frame to any other root node and anyleaf node, and a leaf node may send an Ethernet frame to any root node;and

a leaf node cannot directly connect to and must be isolated from anotherleaf node.

A virtual private local area network service (VPLS) is a technologywhich uses wide area network (WAN) architecture to virtualize anEthernet local area network. The VPLS is capable of providing amultipoint-to-multipoint connection, similar to that of a local areanetwork (LAN), on a multi-protocol label switching (MPLS) network, whichmakes it convenient for users to simultaneously access the MPLS networkfrom multiple geographically scattered points and access each other, asif these points were directly connected to a LAN. Because currently corenetworks mainly use an Internet Protocol (IP)/MPLS technology,requirements of providing a virtual Ethernet service through the VPLS isincreasing and it has already been widely deployed.

An existing technology for providing the E-Tree by using the VPLS is touse different virtual local area networks (VLAN) to identify whetherEthernet frames come from a root node or a leaf node: On a provider edge(PE) device, a corresponding root VLAN identifier or leaf VLANidentifier is added according to whether an E-Tree access port is a rootor leaf, and then a packet marked with the root VLAN identifier or leafVLAN identifier is transferred through a pseudo wire (PW) to a peer PE;and on the peer PE, the VLAN identifier carried in the packet isconverted into a local VLAN identifier, and then correspondingforwarding or filtering is performed; for example, a frame from a rootVLAN is forwarded on a leaf port, a frame from a leaf VLAN is filteredon the leaf port, and the like.

For higher network scalability, each PE may generally use an independentVLAN space of its own, and a PE with a unidirectional PW egress performsappropriate VLAN translation. For example, there is a bidirectional PWbetween a PE 1 and a PE 2, that is, a PW 1 in a forward direction and aPW 2 in a reverse direction are connected; E-Tree service types on thePE 1 are identified as Root1 VLAN and Leaf1 VLAN; and E-Tree servicetypes on the PE 2 are identified as Root2 VLAN and Leaf2 VLAN. The valueof the Root1 VLAN may be different from the value of the Root2 VLAN, andthe value of the Leaf1 VLAN may be different from the value of the Leaf2VLAN. Therefore, an E-Tree service packet borne on the PW 1 in theforward direction from the PE 1 to the PE 2 carries Root1 VLAN or Leaf1VLAN, which is converted on the egress PE 2 into Root2 VLAN or Leaf2VLAN, respectively; and an E-Tree service packet borne on the PW 2 inthe reverse direction from the PE 2 to the PE 1 carries Root2 VLAN orLeaf2 VLAN, which is converted on the egress PE 1 into Root1 VLAN orLeaf1 VLAN, respectively. In this way, four different VLAN identifiersappear on the bidirectional PW, bringing difficulties in E-Tree servicemaintenance and detection.

SUMMARY

Embodiments of the present invention provide a method, an apparatus, anda system for selecting a network device so as to solve the followingproblem during E-Tree service providing in the prior art: When a PE usesan independent VLAN space, four different VLAN identifiers exist on abidirectional PW, bringing difficulties in E-Tree service maintenanceand detection.

To solve the foregoing technical problem, an embodiment of the presentinvention provides a method for selecting a network device, including:

receiving, by a second network device, a network device selectionmessage sent by a first network device, where the network deviceselection message contains a VLAN mapping capability identifier of thefirst network device; and

selecting, by the second network device, according to the VLAN mappingcapability identifier and local VLAN mapping capability, a networkdevice for executing VLAN mapping.

An embodiment of the present invention provides an apparatus forselecting a network device, including:

a receiving module, configured to receive a network device selectionmessage sent by a first network device, where the network deviceselection message contains a VLAN mapping capability identifier of thefirst network device; and

a selecting module, configured to select, according to the VLAN mappingcapability identifier and local VLAN mapping capability, a networkdevice for executing VLAN mapping.

An embodiment of the present invention provides a system for selecting anetwork device, including:

a first network device, configured to send a network device selectionmessage to a second network device, where the network device selectionmessage contains a VLAN mapping capability identifier; and

a second network device, configured to receive the network deviceselection message, and select, according to the VLAN mapping capabilityidentifier and local VLAN mapping capability, a network device forexecuting VLAN mapping.

By using the technical solutions provided in the embodiments of thepresent invention, it may be ensured that VLAN mapping is executed for aPW in a forward direction and a PW in a reverse direction on a same PE,and there are only two VLAN identifiers on a bidirectional PW, therebyensuring consistency of VLANs in the bidirectional PW and making itsimpler and easier to maintain and detect the PW.

BRIEF DESCRIPTION OF DRAWINGS

To describe the technical solutions in the embodiments of the presentinvention or in the prior art more clearly, the following brieflyintroduces accompanying drawings required for describing the embodimentsor the prior art. Apparently, the accompanying drawings in the followingdescription show merely some embodiments of the present invention, and aperson having ordinary skill in the art may still derive other drawingsfrom these accompanying drawings without creative efforts.

FIG. 1 is a flowchart of a method for selecting a network deviceaccording to a first embodiment of the present invention;

FIG. 2 is a schematic diagram of a network on which an E-Tree service isprovided by using a VPLS technology;

FIG. 3 is a flowchart of a method for selecting a network deviceaccording to a second embodiment of the present invention;

FIG. 4 is a block diagram of an apparatus for selecting a network deviceaccording to a third embodiment of the present invention; and

FIG. 5 is a schematic diagram of a system for selecting a network deviceaccording to a fourth embodiment of the present invention.

DESCRIPTION OF EMBODIMENTS

The following is an exemplary description of a specific implementationprocess of the present invention by using embodiments. Apparently, theembodiments described in the following are merely a part rather than allof the embodiments of the present invention. All other embodimentsobtained by a person having ordinary skill in the art based on theembodiments of the present invention without creative efforts shall fallwithin the protection scope of the present invention.

An embodiment of the present invention provides a method for selecting anetwork device. The method includes: receiving, by a second networkdevice, a network device selection message sent by a first networkdevice, where the network device selection message contains a VLANmapping capability identifier of the first network device; andselecting, by the second network device, according to the VLAN mappingcapability identifier and local VLAN mapping capability, a networkdevice for executing VLAN mapping. By using the technical solutionprovided in this embodiment of the present invention, it may be ensuredthat VLAN mapping is executed for a PW in a forward direction and a PWin a reverse direction on a same PE, and there are only two VLANidentifiers on a bidirectional PW, thereby ensuring consistency of VLANsin the bidirectional PW and making it simpler and easier to maintain anddetect the PW.

To make the objectives, features, and advantages of the embodiment ofthe present invention more obvious and comprehensible, the followingfurther describes this embodiment of the present invention in detailwith reference to the accompanying drawings and specific embodiments.

Refer to FIG. 1, which is a flowchart of a method for selecting anetwork device according to a first embodiment of the present invention.Specific steps are as follows:

Step 101: A second network device receives a network device selectionmessage sent by a first network device, where the network deviceselection message contains a VLAN mapping capability identifier of thefirst network device.

The first network device and the second network device may be provideredge (PE) devices on a VPLS network. The first network device may carrythe VLAN mapping capability identifier of the first network device byextending a label distribution protocol (LDP) message or a bordergateway protocol (BGP) message.

Step 102: The second network device selects, according to the VLANmapping capability identifier and local VLAN mapping capability, anetwork device for executing VLAN mapping.

The selecting a network device for executing VLAN mapping is completedthrough automatic negotiation according to the VLAN mapping capabilityidentifier. For example, as shown in FIG. 2, a bidirectional PW needs tobe established between a PE 1 and a PE 2 so as to provide an E-Treeservice. The bidirectional PW is formed of a PW 1 in a forward directionand a PW 2 in a reverse direction. During establishment of the PW 1 inthe forward direction, the PE 2 at an egress end sends an extended LDPmessage to the PE 1 at an ingress end, where an E-Tree-related sub-TLVis added in a PW interface parameter TLV (Type-Length-Value) in theextended LDP message, to carry a VLAN mapping capability identifier V2of the PE 2. After receiving the extended LDP message, the PE 1establishes the PW 1 in the forward direction and selects, according tolocal VLAN mapping capability and the V2 carried in the extended LDPmessage, a network device for executing VLAN mapping. Duringestablishment of the PW 2 in the reverse direction, the PE 1 at anegress end sends an extended LDP message that carries V1 to the PE 2 atan ingress end. After receiving the extended LDP message, the PE 2establishes the PW 2 in the reverse direction and selects, according tolocal VLAN mapping capability and the V1 carried in the extended LDPmessage, a network device for executing VLAN mapping.

When it is determined according to the V1 and the V2 that only one PEout of the PE 1 and the PE 2 has VLAN mapping capability, the PE isselected as the network device for executing VLAN mapping.

Refer to FIG. 3, which is a flowchart of a method for selecting anetwork device according to a second embodiment of the presentinvention. Specific steps are as follows:

Step 201: A second network device receives a network device selectionmessage sent by a first network device, where the network deviceselection message contains a VLAN mapping capability identifier and adevice identifier of the first network device.

The first network device and the second network device may be provideredge (PE) devices on a VPLS network; the first network device may carrythe VLAN mapping capability identifier and the device identifier of thefirst network device by extending a LDP message or a BGP message; andwhen the device identifier of the first network device is an IP address,the device identifier may be obtained from an IP packet header of thenetwork device selection message, and a specific field does not need tobe extended in the network device selection message.

Step 202: The second network device selects, according to the VLANmapping capability identifier, the device identifier, local VLAN mappingcapability, and a local device identifier, a network device forexecuting VLAN mapping.

The selecting a network device for executing VLAN mapping is completedthrough automatic negotiation according to the VLAN mapping capabilityidentifier and the device identifiers. For example, as shown in FIG. 2,a bidirectional PW needs to be established between a PE 1 and a PE 2 soas to provide an E-Tree service. The bidirectional PW is formed of a PW1 in a forward direction and a PW 2 in a reverse direction. Duringestablishment of the PW 1 in the forward direction, the PE 2 at anegress end sends an extended LDP message to the PE 1 at an ingress end,where an E-Tree-related sub-TLV (sub TLV) is added in a PW interfaceparameter TLV (Type-Length-Value) in the extended LDP message, to carrya VLAN mapping capability identifier V2 and a device identifier Node ID2of the PE 2. After receiving the extended LDP message, the PE 1establishes the PW 1 in the forward direction and selects, according tolocal VLAN mapping capability and a local device identifier Node ID1 aswell as the V2 and Node ID2 carried in the extended LDP message, anetwork device for executing VLAN mapping. During establishment of thePW 2 in the reverse direction, the PE 1 at an egress end sends anextended LDP message that carries V1 and the Node ID1 to the PE 2 at aningress end. After receiving the extended LDP message, the PE 2establishes the PW 2 in the reverse direction and selects, according tolocal VLAN mapping capability and the Node ID2 as well as the V1 andNode ID1 carried in the extended LDP message, a network device forexecuting VLAN mapping.

When it is determined according to the V1 and the V2 that both the PE 1and the PE 2 have VLAN mapping capability, one PE is selected, accordingto the device identifiers Node ID1 and Node ID2, as the network devicefor executing VLAN mapping. For example, a selection policy is to selecta PE with a smallest device identifier as the network device forexecuting VLAN mapping; for example, if the NodeID1 is smaller than theNodeID2, the PE 1 is selected to execute VLAN mapping whereas the PE 2disables a local VLAN mapping function. If Node IDs are not in anumerical form, the Node IDs may be sorted so that a network device,such as a network device corresponding to a front-most Node ID after thesorting, is selected according to a sequence of the device identifiers.

According to the technical solution provided in the embodiments of thepresent invention, the bidirectional PW executes VLAN mapping on thesame PE device, for example, on the PE 1. When the PE 1 wants to send anEthernet frame of the E-Tree service to the PE 2 through the PW 1, thePE 1 first executes VLAN mapping to map local VLAN identifiers Root1 andLeaf1 to VLAN identifiers Root2 and Leaf2 of the peer PE 2 respectively,and then sends a packet marked with a VLAN identifier Root2 or Leaf2 tothe PE 2 through the PW 1. After receiving the packet, the PE 2 directlyforwards the packet to a corresponding Root or Leaf port according tothe VLAN identifier Root2 or Leaf2. On the contrary, when the PE 2 sendsan Ethernet frame of the E-Tree service to the PE 1 through a PW 2, thePE 2 directly sends a packet marked with the VLAN identifier Root2 orLeaf2 to the PE 1 through the PW 2. After receiving the packet, the PE 1first executes VLAN mapping to map the Root2 or Leaf2 to the local Root1or Leaf1, and then forwards the packet to a corresponding Root or Leafport. Therefore, packets borne on the PW 1 and the PW 2 all carry theRoot2 or Leaf2, thereby solving the following problem in the prior art:When PEs separately perform VLAN mapping, four different VLANidentifiers exist on a bidirectional PW, bringing difficulties inservice maintenance and detection.

Refer to FIG. 4, which is a block diagram of an apparatus for selectinga network device according to a third embodiment of the presentinvention. The apparatus specifically includes a receiving module 301and a selecting module 302, where:

the receiving module 301 is configured to receive a network deviceselection message sent by a first network device, and the network deviceselection message contains a VLAN mapping capability identifier; and

the selecting module 302 is configured to select, according to the VLANmapping capability identifier and local VLAN mapping capability, anetwork device for executing VLAN mapping.

The network device selection message may further contain a deviceidentifier of the first network device; and

accordingly, the selecting module 302 is configured to select, accordingto the VLAN mapping capability identifier, the device identifier, thelocal VLAN mapping capability, and a local device identifier, thenetwork device for executing VLAN mapping.

When it is determined, according to the VLAN mapping capabilityidentifier and the local VLAN mapping capability, that both a localnetwork device and the first network device have VLAN mappingcapability, the selecting module is specifically configured to select,according to sizes or a sequence of the device identifier and the localdevice identifier, a network device for executing VLAN mapping.

Refer to FIG. 5, which is a schematic diagram of a system for selectinga network device according to a fourth embodiment of the presentinvention. The system includes:

a first network device 401, configured to send a network deviceselection message to a second network device 402, where the networkdevice selection message contains a VLAN mapping capability identifierof the first network device 401; and

the second network device 402, configured to receive the network deviceselection message, and select, according to the VLAN mapping capabilityidentifier and local VLAN mapping capability, a network device forexecuting VLAN mapping.

The network device selection message may further contain a deviceidentifier of the first network device; and

accordingly, the second network device 402 is configured to receive thenetwork device selection message, and select, according to the VLANmapping capability identifier, the device identifier, the local VLANmapping capability, and a local device identifier, the network devicefor executing VLAN mapping.

The first network device and the second network device may be provideredge (PE) devices on a VPLS network. The first network device may use anextended LDP message or a BGP message to send the network deviceselection message to the second network device.

By using the technical solutions provided in the embodiments of thepresent invention, because a network device for executing VLAN mappingis selected by using a device selection message, it may be ensured thatVLAN mapping is executed for a PW in a forward direction and a PW in areverse direction on the same PE, thereby solving the following problemin the prior art: When PEs separately perform VLAN mapping, fourdifferent VLAN identifiers exist on a bidirectional PW, bringingdifficulties in service maintenance and detection.

Although all the embodiments of the present invention describenegotiation between only two PEs for selecting a network device forexecuting VLAN mapping, for an E-Tree composed of more PEs, a process ofnegotiation and selection between any two PEs may still use thetechnical solutions provided in embodiments of the present invention.

It should be noted that the relational terms herein such as first andsecond are used only to differentiate an entity or operation fromanother entity or operation, and do not require or imply any actualrelationship or sequence between these entities or operations. Moreover,the terms “include”, “contain”, and any variation thereof are intendedto cover a non-exclusive inclusion. Therefore, a process, method,object, or device that includes a series of elements not only includesthese elements, but also includes other elements not specifiedexpressly, or may include inherent elements of the process, method,object, or device. If no more limitations are made, an element limitedby “include a/an . . . ” does not exclude other same elements existingin the process, the method, the article, or the device which includesthe element.

A person having ordinary skill in the art should understand that all ora part of the steps in the method embodiments may be implemented by aprogram instructing relevant hardware. The program may be stored in acomputer readable storage medium. When the program is run, the steps inthe method embodiments are performed. The storage medium may be anymedium capable of storing program codes, such as a ready-only memory(ROM), a random-access memory (RAM), a magnetic disk, or an opticaldisk.

The foregoing descriptions are merely specific exemplary embodiments ofthe present invention, but are not intended to limit the protectionscope of the present invention. Any variation or replacement readilyfigured out by the skilled person within the technical scope disclosedin the present invention shall fall within the protection scope of thepresent invention. Therefore, the protection scope of the presentinvention shall be subject to the protection scope of the claims.

What is claimed is:
 1. An apparatus, comprising: a computing hardware,and a non-transitory computer readable storage medium includingcomputer-executable instructions, wherein the computer-executableinstructions, when executed by the computing hardware, facilitate thefollowing being performed on the apparatus: receiving a network deviceselection message from a first network device, wherein the networkdevice selection message contains a virtual local area network (VLAN)mapping capability identifier of the first network device and a deviceidentifier of the first network device, determining whether theapparatus and the first network device have VLAN mapping capabilityaccording to local VLAN mapping capability of the apparatus and the VLANmapping capability identifier of the first network device; anddetermining whether the apparatus is to execute VLAN mapping, whereindetermining whether the apparatus is to execute VLAN mapping comprises:in response to determining that both the apparatus and the first networkdevice have VLAN mapping capability according to the local VLAN mappingcapability of the apparatus and the VLAN mapping capability identifierof the first network device, determining that the apparatus is toexecute VLAN mapping based on comparing sizes of a local deviceidentifier of the apparatus and the device identifier of the firstnetwork device or based on sorting the local device identifier of theapparatus and the device identifier of the first network device into asequence, and in response to determining that only the apparatus hasVLAN mapping capability according to the local VLAN mapping capabilityof the apparatus and the VLAN mapping capability identifier of the firstnetwork device, determining that the apparatus is to execute VLANmapping.
 2. The apparatus according to claim 1, wherein the networkdevice selection message comprises a label distribution protocol (LDP)message that contains the VLAN mapping capability identifier of thefirst network device.
 3. The apparatus according to claim 1, wherein thenetwork device selection message comprises a border gateway protocol(BGP) message that contains the VLAN mapping capability identifier ofthe first network device.
 4. The apparatus according to claim 1, whereindetermining whether the apparatus is to execute VLAN mapping comprises:in response to determining that both the apparatus and the first networkdevice have VLAN mapping capability according to the local VLAN mappingcapability of the apparatus and the VLAN mapping capability identifierof the first network device, determining that the apparatus is toexecute VLAN mapping based on comparing sizes of the local deviceidentifier of the apparatus and the device identifier of the firstnetwork device.
 5. The apparatus according to claim 1, whereindetermining whether the apparatus is to execute VLAN mapping comprises:in response to determining that both the apparatus and the first networkdevice have VLAN mapping capability according to the local VLAN mappingcapability of the apparatus and the VLAN mapping capability identifierof the first network device, determining that the apparatus is toexecute VLAN mapping based on sorting the local device identifier of theapparatus and the device identifier of the first network device into thesequence.
 6. A system, comprising: an apparatus, configured to: receivea first network device selection message from the first network device,wherein the first network device selection message contains a virtuallocal area network (VLAN) mapping capability identifier of the firstnetwork device and a device identifier of the first network device,determine whether the apparatus and the first network device have VLANmapping capability according to VLAN mapping capability of the apparatusand the VLAN mapping capability identifier of the first network device;and determine whether the apparatus is to execute VLAN mapping, whereindetermining whether the apparatus is to execute VLAN mapping comprises:in response to determining that both the apparatus and the first networkdevice have VLAN mapping capability according to the VLAN mappingcapability of the apparatus and the VLAN mapping capability identifierof the first network device, determining that the apparatus is toexecute VLAN mapping based on comparing sizes of a device identifier ofthe apparatus and the device identifier of the first network device orbased on sorting the device identifier of the apparatus and the deviceidentifier of the first network device into a sequence; and in responseto determining that only the apparatus has VLAN mapping capabilityaccording to the VLAN mapping capability of the apparatus and the VLANmapping capability identifier of the first network device; determiningthat the apparatus is to execute VLAN mapping; and the first networkdevice; configured to: receive a second network device selection messagefrom the apparatus, wherein the second network device selection messagecontains a VLAN mapping capability identifier of the apparatus and thedevice identifier of the apparatus; determine whether the first networkdevice and the apparatus have VLAN mapping capability according to theVLAN mapping capability of the first network device and the VLAN mappingcapability identifier of the apparatus; and determine whether the firstnetwork device is to execute VLAN mapping; wherein determining whetherthe first network device is to execute VLAN mapping comprises: inresponse to determining that both the first network device and theapparatus have VLAN mapping capability according to the VLAN mappingcapability of the first network device and the VLAN mapping capabilityidentifier of the apparatus, determining that the first network deviceis not to execute VLAN mapping based on comparing sizes of the deviceidentifier of apparatus and the device identifier of the first networkdevice or based on sorting the device identifier of the apparatus andthe device identifier of the first network device into the sequence; andin response to determining that only the apparatus has VLAN mappingcapability according to the VLAN mapping capability of the first networkdevice and the VLAN mapping capability identifier of the apparatus,determining that the first network device is not to execute VLANmapping.
 7. The system according to claim 6, wherein determining whetherthe apparatus is to execute VLAN mapping comprises: in response todetermining that both the apparatus and the first network device haveVLAN mapping capability according to the VLAN mapping capability of theapparatus and the VLAN mapping capability identifier of the firstnetwork device, determining that the apparatus is to execute VLANmapping based on comparing sizes of the device identifier of theapparatus and the device identifier of the first network device; andwherein determining whether the first network device is to execute VLANmapping comprises: in response to determining that both the firstnetwork device and the apparatus have VLAN mapping capability accordingto the VLAN mapping capability of the first network device and the VLANmapping capability identifier of the apparatus, determining that thefirst network device is not to execute VLAN mapping based on comparingsizes of the device identifier of apparatus and the device identifier ofthe first network device.
 8. The system according to claim 6, whereindetermining whether the apparatus is to execute VLAN mapping comprises:in response to determining that both the apparatus and the first networkdevice have VLAN mapping capability according to the VLAN mappingcapability of the apparatus and the VLAN mapping capability identifierof the first network device, determining that the apparatus is toexecute VLAN mapping based on sorting the device identifier of theapparatus and the device identifier of the first network device into thesequence, and wherein determining whether the first network device is toexecute VLAN mapping comprises: in response to determining that both thefirst network device and the apparatus have VLAN mapping capabilityaccording to the VLAN mapping capability of the first network device andthe VLAN mapping capability identifier of the apparatus, determiningthat the first network device is not to execute VLAN mapping based onsorting the device identifier of the apparatus and the device identifierof the first network device into the sequence.
 9. A method, comprising:receiving, by an apparatus, a network device selection message from afirst network device, wherein the network device selection messagecontains a virtual local area network (VLAN) mapping capabilityidentifier of the first network device and a device identifier of thefirst network device, determining, by the apparatus, whether theapparatus and the first network device have VLAN mapping capabilityaccording to local VLAN mapping capability of the apparatus and the VLANmapping capability identifier of the first network device, anddetermining, by the apparatus, whether the apparatus is to execute VLANmapping, wherein: in case that the apparatus determines that both theapparatus and the first network device have VLAN mapping capabilityaccording to the local VLAN mapping capability of the apparatus and theVLAN mapping capability identifier of the first network device,determining whether the apparatus is to execute VLAN mapping comprisesdetermining that the apparatus is to execute VLAN mapping based oncomparing sizes of a local device identifier of the apparatus and thedevice identifier of the first network device or based on sorting thelocal device identifier of the apparatus and the device identifier ofthe first network device into a sequence, and in case that the apparatusdetermines that only the apparatus has VLAN mapping capability accordingto the local VLAN mapping capability of the apparatus and the VLANmapping capability identifier of the first network device, determiningwhether the apparatus is to execute VLAN mapping comprises determiningthat the apparatus is to execute VLAN mapping.
 10. The method accordingto claim 9, wherein the network device selection message comprises alabel distribution protocol (LDP) message that contains the VLAN mappingcapability identifier of the first network device.
 11. The methodaccording to claim 9, wherein the network device selection messagecomprises a border gateway protocol (BGP) message that contains the VLANmapping capability identifier of the first network device.
 12. Themethod according to claim 9, wherein in case that the apparatusdetermines that both the apparatus and the first network device haveVLAN mapping capability according to the local VLAN mapping capabilityof the apparatus and the VLAN mapping capability identifier of the firstnetwork device, determining whether the apparatus is to execute VLANmapping comprises determining that the apparatus is to execute VLANmapping based on comparing sizes of the local device identifier of theapparatus and the device identifier of the first network device.
 13. Themethod according to claim 9, wherein in case that the apparatusdetermines that both the apparatus and the first network device haveVLAN mapping capability according to the local VLAN mapping capabilityof the apparatus and the VLAN mapping capability identifier of the firstnetwork device, determining whether the apparatus is to execute VLANmapping comprises determining that the apparatus is to execute VLANmapping based on sorting the local device identifier of the apparatusand the device identifier of the first network device into the sequence.